Skip to content

Support Solidity ABI encoded constructor dispatch #2525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 2, 2025
Merged

Conversation

davidsemakula
Copy link
Collaborator

@davidsemakula davidsemakula commented Jun 18, 2025

Summary

Closes #2518

  • [y] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependent on a specific version of cargo-contract or pallet-revive?

Description

See #2518 for details

Checklist before requesting a review

  • I have added an entry to CHANGELOG.md
  • I have commented on my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@davidsemakula davidsemakula force-pushed the semakula/sol-ctor branch 5 times, most recently from 9739858 to a6db285 Compare June 19, 2025 16:08
Copy link

github-actions bot commented Jun 19, 2025

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

These are the results when building the integration-tests/* contracts from this branch with 0 and comparing them to ink! master:

Show Results
Contract Upstream Size (kB) PR Size (kB) Diff (kB) Diff (%) Change
call-builder-return-value 20.783 20.948 0.165 0.793918 📈
call-runtime 2.194 2.195 0.001 0.0455789 📈
combined-extension 2.51 2.51 0 0
complex-storage-structures 4.296 4.296 0 0
conditional-compilation 1.448 1.448 0 0
contract-invocation 7.937 7.914 -0.023 -0.289782 📉
contract-invocation/contract1 1.844 1.844 0 0
contract-invocation/contract2 1.804 1.804 0 0
contract-invocation/virtual_contract 4.222 4.326 0.104 2.46329 📈
contract-invocation/virtual_contract_ver1 1.852 1.852 0 0
contract-invocation/virtual_contract_ver2 1.864 1.864 0 0
contract-storage 18.448 18.448 0 0
contract-terminate 1.414 1.414 0 0
contract-transfer 3.036 3.036 0 0
contract-xcm 28.207 28.206 -0.001 -0.00354522 📉
cross-contract-calls 8.774 8.563 -0.211 -2.40483 📉
cross-contract-calls/other-contract 1.524 1.524 0 0
custom-allocator 3.012 3.012 0 0
custom-environment 2.23 2.23 0 0
debugging-strategies 4.086 4.001 -0.085 -2.08027 📉
dns 8.06 8.06 0 0
e2e-call-runtime 1.673 1.674 0.001 0.0597729 📈
e2e-runtime-only-backend 2.25 2.249 -0.001 -0.0444444 📉
erc1155 19.194 19.196 0.002 0.0104199 📈
erc20 9.445 9.445 0 0
erc721 11.034 11.035 0.001 0.0090629 📈
events 5.982 5.982 0 0
flipper 1.597 1.597 0 0
incrementer 1.284 1.284 0 0
lang-err/call-builder 8.457 8.474 0.017 0.201017 📈
lang-err/call-builder-delegate 3.136 3.157 0.021 0.669643 📈
lang-err/constructors-return-value 2.226 2.226 0 0
lang-err/contract-ref 7.626 7.671 0.045 0.590087 📈
lang-err/integration-flipper 1.795 1.795 0 0
lazyvec 4.908 4.907 -0.001 -0.0203749 📉
mapping 9.507 9.507 0 0
mother 13.622 13.622 0 0
multi-contract-caller 12.784 12.803 0.019 0.148623 📈
multi-contract-caller/accumulator 1.141 1.138 -0.003 -0.262927 📉
multi-contract-caller/adder 3.129 3.119 -0.01 -0.319591 📉
multi-contract-caller/subber 3.137 3.127 -0.01 -0.318776 📉
multisig 24.379 24.434 0.055 0.225604 📈
own-code-hash 2.204 2.204 0 0
payment-channel 11.015 10.969 -0.046 -0.417612 📉
psp22-extension 7.378 7.378 0 0
rand-extension 3.451 3.451 0 0
runtime-call-contract 1.527 1.527 0 0
solidity-abi/events 9.361 11.301 1.94 20.7243 📈
solidity-abi/sol-cross-contract 6.679 6.709 0.03 0.449169 📈
solidity-abi/sol-cross-contract/other-contract-sol 2.474 1.634 -0.84 -33.9531 📉
solidity-abi/sol-cross-contract/other-contract-sol 2.474 2.656 0.182 7.35651 📈
solidity-abi/sol-encoding 2.403 2.584 0.181 7.53225 📈
solidity-abi/solidity-calls-flipper 8.733 8.726 -0.007 -0.0801557 📉
solidity-abi/trait-dyn-cross-contract-calls 5.613 6.421 0.808 14.3952 📈
solidity-abi/trait-dyn-cross-contract-calls/contracts/incrementer 2.447 1.589 -0.858 -35.0633 📉
solidity-abi/trait-dyn-cross-contract-calls/contracts/incrementer 2.447 2.422 -0.025 -1.02166 📉
solidity-abi/trait-flipper 2.214 2.189 -0.025 -1.12918 📉
sr25519-verification 0.957 0.957 0 0
static-buffer 2.502 2.502 0 0
storage-types 15.914 15.909 -0.005 -0.0314189 📉
trait-dyn-cross-contract-calls 3.579 3.594 0.015 0.419111 📈
trait-dyn-cross-contract-calls/contracts/incrementer 1.589 1.589 0 0
trait-erc20 9.745 9.745 0 0
trait-flipper 1.449 1.449 0 0
trait-incrementer 1.659 1.659 0 0
upgradeable-contracts/delegator 5.878 5.91 0.032 0.544403 📈
upgradeable-contracts/delegator/delegatee 2.62 2.62 0 0
upgradeable-contracts/delegator/delegatee2 2.62 2.62 0 0
upgradeable-contracts/set-code-hash 1.503 1.503 0 0
upgradeable-contracts/set-code-hash-migration 1.503 1.503 0 0
upgradeable-contracts/set-code-hash-migration/migration 1.67 1.67 0 0
upgradeable-contracts/set-code-hash-migration/updated-incrementer 1.701 1.701 0 0
upgradeable-contracts/set-code-hash/updated-incrementer 1.463 1.463 0 0
wildcard-selector 2.79 2.79 0 0

Link to the run | Last update: Sun Jun 29 20:38:40 CEST 2025

@davidsemakula davidsemakula force-pushed the semakula/sol-ctor branch 3 times, most recently from 4c6e6ca to 4de1bdf Compare June 26, 2025 15:48
@davidsemakula davidsemakula marked this pull request as ready for review June 26, 2025 15:49
@davidsemakula davidsemakula requested review from evilrobot-01 and removed request for ascjones June 26, 2025 15:49
///
/// Should only be used for Solidity ABI encoded constructors/instantiation.
#[inline]
pub fn no_selector() -> Self {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to see that you implemented this here, we'll also need it for calling the pre-compiles.

@cmichi cmichi merged commit f077045 into master Jul 2, 2025
56 of 67 checks passed
@cmichi cmichi deleted the semakula/sol-ctor branch July 2, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle Solidity ABI encoded constructor dispatch
2 participants